import request from './request'

/**
 * 获取标签列表
 * @param {*} params
 * @returns
 */
export const getFieldList = (params) => {
  return request({
    url: '/field/list',
    params
  })
}

/**
 * 新增标签
 * @param {*} data
 * @returns
 */
export const addField = (data) => {
  return request({
    url: '/field/add',
    method: 'post',
    data
  })
}

/**
 * 修改标签
 * @param {*} data
 * @returns
 */
export const updateField = (data) => {
  return request({
    url: '/field/update',
    method: 'put',
    data
  })
}

/**
 * 根据Id删除标签
 * @param {*} id
 */
export const deleteField = (id) => {
  return request({
    url: `/field/${id}`,
    method: 'delete'
  })
}
